home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / loancalc.arc / RROUND.PAS < prev    next >
Pascal/Delphi Source File  |  1991-04-28  |  394b  |  10 lines

  1. FUNCTION RealRound(num: real; digits: integer): real;
  2. {Round a real number to digits decimal places to the
  3.  right of the decimal point.  Negative digits round
  4.  to the left of the decimal point.}
  5. BEGIN
  6.   IF num >= 0 THEN
  7.     RealRound := RealTrunc(num + 0.5 * IntRaise(10, -digits), digits)
  8.   ELSE
  9.     RealRound := RealTrunc(num - 0.5 * IntRaise(10, -digits), digits)
  10. END;  {RealRound}